Using Overleaf to edit latex

Using latex enables you to focus more on content than on formatting gibberish. I used to use VSCODE to edit latex document, until one day my Italian crew told me about this platform. It’s runs much faster than VS! So just forget about VSCODE, let’s start latex with Overleaf.

There are some problems encountered during using Overleaf, this document records how to solve.

At first, if u need any help, don’t hesitate to search it in Overleaf guide
I briefly introduced LaTeX in the previous article, you can read it if you are interested.Latex note

.cls file stores some configuration items, for example, we can see the renew command ‘maketitle’

\renewcommand{\@maketitle}{%
    \twocolumn[{%
    \thispagestyle{empty}%
    \vskip-36pt%
    {\raggedleft\small\sffamily\bfseries\@JournalInfo\\\@Archive\par}%
    \vskip20pt%
    {\raggedright\color{color1}\sffamily\bfseries\fontsize{20}{25}\selectfont \@PaperTitle\par}%
    \vskip10pt%
    {\raggedright\color{color1}\sffamily\fontsize{12}{16}\selectfont  \@Authors\par}%
    %\vskip18pt%
    % \fcolorbox{color1}{white}{%
    % \parbox{\textwidth-2\fboxsep-2\fboxrule}{\centering%
    % \colorbox{color2!10}{%
    % \parbox{\textwidth-4\fboxsep-2\fboxrule}{%
    % \ifx\@Keywords\@empty%
    % \sffamily\textbf{\abstractname}\\\@Abstract%
    % \else%
    % \sffamily\textbf{\abstractname}\\\@Abstract\\[4pt]%
    % \textbf{\keywordname}\\\@Keywords%
    % \fi%
    % }%
    % }%
    % \vskip4pt%
    % \begingroup%
    % \raggedright\sffamily\small%
    % \footnotesize\@affiliation\par%
    % \endgroup%%
    % }%
    % }%
    \vskip18pt%
    }]%
}

Pro1. Table always above the heading

I use Tables Generator to generator a table. However, when I insert the code below, the table always above the heading.

\begin{table}[]
\begin{tabular}{lllll}
 &  &  &  &  \\
 &  &  &  &  \\
 &  &  &  &  \\
 &  &  &  & 
\end{tabular}
\end{table}

So, I rewrite like this:

\begin{table}[H]
    \renewcommand{\arraystretch}{1.3}
        \caption{Measured data}
    \label{tab1}
%     \centering
    \setlength{\tabcolsep}{3mm}
    \begin{tabular}{p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}}
        \hline
        R_N        & R_{N+1}    & r_{N}      & B_{ext}(T)    \\ \hline
        238.0      & 127.2      & 10.2       & 0.636      \\ 
        234.0      & 127.4      & 10.0       & 0.585      \\ 
        234.8      & 126.4      & 12.0       & 0.537      \\ 
        237.2      & 127.8      & 10.8       & 0.586      \\ 
        236.9      & 128.0      & 11.7       & 0.572      \\ 
        237.7      & 128.2      & 11.0       & 0.558      \\ 
        236.3      & 127.6      & 10.2       & 0.620      \\ \hline     
    \end{tabular}
    \label{bs2}
\end{table}

I use a view of two column, so this code may not be suitable for you!

Pro.2 Multi-line mathematical formula

I use Mathpix Snipping tools https://mathpix.com/ when entering complex mathematical formulas. While gather* has no number.
When using \begin{equation}, it can auto numbering

   \begin{equation}
         E_{z}^{1}=\mu_{B} B_{e x} g_{j} M_{j}
    \end{equation}
    So we can get: 
    \begin{gather*}
        E_{1} = \mu _{B}  B_{ext} M_{j1} g_{j1}  \\
        E_{2} = \mu _{B}  B_{ext} M_{j2} g_{j2}  
    \end{gather*}

We also can use align to write formula.
Also can use \notag to cancel automatic numbering.

\begin{align}
       \sigma_{\mu _{B}}^2&= \left(\frac{\partial \mu _{B}}{\partial r_{N}}\right)^{2} \sigma_{r_N}^{2}+\left(\frac{\partial \mu _{B}}{\partial B}\right)^{2} \sigma_{B}^{2}\notag\\
       &+\left(\frac{\partial \mu _{B}}{\partial R_{N}}\right)^{2} \sigma_{R_N}^{2}+\left(\frac{\partial \mu _{B}}{\partial R_{N+1}}\right)^{2} \sigma_{R_{N+1}}^{2}\notag
    \end{align}

Maybe these website can help u!
常用数学符号的 LaTeX 表示方法
LaTex 常用的公式语法
LaTeX公式编辑器

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2018-2021 Quincy
  • Visitors: | Views:

请我吃串串呗~

支付宝
微信